import requests

import time

times = time.time()*1000

cookies = {
    'cookie2': '1bc9eb9edd0aa24206057b082af2fc16',
    't': '4df76169d3b4a374c2f45cdf32470caa',
    '_tb_token_': 'e535ba53e8d47',
    'thw': 'cn',
    'xlly_s': '1',
    'ctoken': '5dqcUuEV6FP_g6SdW9ZdCvZI',
    'lego2_cna': 'P158KH4Y8E8KTWM1PKCKE0XU',
    'cna': 'yJ+YIWfuNlwCAXsOOqsB+sO9',
    'arms_uid': '9130aef4-38b6-4985-9f9d-0f20b50dbb12',
    '_samesite_flag_': 'true',
    'mtop_partitioned_detect': '1',
    '_m_h5_tk': 'ac0d46274016936913e650ae2070de94_1762788109772',
    '_m_h5_tk_enc': '24c5655b08b0a0b36c4094118ef8ec5b',
    '3PcFlag': f'{times}',
    'tfstk': 'gNV-jsssTijo3wtyykXcKWKIqMQmpt4yMuz6tDmkdoEYSo_rKMzIRXEbxaouRgrL9maUEYcSxvnQjk33ZWVL3BUa87brtalzzXlCjGfg9zzrTpgNxfF-cqgTl2tIFtcfVZI48GfGsz9XsmQAj8DRwH0ZSBGIFvtjhmuKA3iQAxOj8mOSRQgBcZ3EcXOIFv1fGV09AQ97Ar_x8miIOXZIGZ3EcDGIOAE9FDJ-jBerAL0E1QtG61FxyYnptmdLv5OihcaSDBsEC4KEfzivOBisVgT_kzjJ_rczsl3gqsO8XyaadxFpcGnUMrN7dr-RAqyQqjio1TTxZ7z7CvN1YpZtwkH_NxLBwjGxAj3b1wvZmSnuA7HfSCHnG5DsN-XVqvc-WkNz2edQfr4gaxPdXniUEVljJW76pDHC40Pg6PNpjc3HFZQvLpkSuCMvBJdLkkkZkcb0upJEHt0xjZQvLpkSuqnGorJeLxBc.',
    'isg': 'BHx8kfRuOR66ng3CtyVc134TTRoudSCfWyJc51b5LWYnIRmrfoSqLuvTBUlZb1j3',
}

headers = {
    'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
    'accept-language': 'zh-CN,zh;q=0.9',
    'cache-control': 'no-cache',
    'pragma': 'no-cache',
    'priority': 'u=0, i',
    'referer': 'https://www.taobao.com/',
    'sec-ch-ua': '"Chromium";v="142", "Google Chrome";v="142", "Not_A Brand";v="99"',
    'sec-ch-ua-mobile': '?0',
    'sec-ch-ua-platform': '"Windows"',
    'sec-fetch-dest': 'document',
    'sec-fetch-mode': 'navigate',
    'sec-fetch-site': 'same-origin',
    'sec-fetch-user': '?1',
    'upgrade-insecure-requests': '1',
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36',
    # 'cookie': 'cookie2=1bc9eb9edd0aa24206057b082af2fc16; t=4df76169d3b4a374c2f45cdf32470caa; _tb_token_=e535ba53e8d47; thw=cn; xlly_s=1; ctoken=5dqcUuEV6FP_g6SdW9ZdCvZI; lego2_cna=P158KH4Y8E8KTWM1PKCKE0XU; cna=yJ+YIWfuNlwCAXsOOqsB+sO9; arms_uid=9130aef4-38b6-4985-9f9d-0f20b50dbb12; _samesite_flag_=true; mtop_partitioned_detect=1; _m_h5_tk=ac0d46274016936913e650ae2070de94_1762788109772; _m_h5_tk_enc=24c5655b08b0a0b36c4094118ef8ec5b; 3PcFlag=1762781333467; tfstk=gNV-jsssTijo3wtyykXcKWKIqMQmpt4yMuz6tDmkdoEYSo_rKMzIRXEbxaouRgrL9maUEYcSxvnQjk33ZWVL3BUa87brtalzzXlCjGfg9zzrTpgNxfF-cqgTl2tIFtcfVZI48GfGsz9XsmQAj8DRwH0ZSBGIFvtjhmuKA3iQAxOj8mOSRQgBcZ3EcXOIFv1fGV09AQ97Ar_x8miIOXZIGZ3EcDGIOAE9FDJ-jBerAL0E1QtG61FxyYnptmdLv5OihcaSDBsEC4KEfzivOBisVgT_kzjJ_rczsl3gqsO8XyaadxFpcGnUMrN7dr-RAqyQqjio1TTxZ7z7CvN1YpZtwkH_NxLBwjGxAj3b1wvZmSnuA7HfSCHnG5DsN-XVqvc-WkNz2edQfr4gaxPdXniUEVljJW76pDHC40Pg6PNpjc3HFZQvLpkSuCMvBJdLkkkZkcb0upJEHt0xjZQvLpkSuqnGorJeLxBc.; isg=BHx8kfRuOR66ng3CtyVc134TTRoudSCfWyJc51b5LWYnIRmrfoSqLuvTBUlZb1j3',
}

params = {
    'bc_fl_src': 'tbsite_NOX36458',
    'bd_vid': '9917436330585418794',
    'channelSrp': 'baiduSomama',
    'clk1': '74926a621f35c129be749a22e0b14c28',
    'keyword': '电脑',
    'localImgKey': '',
    'page': '1',
    'q': '电脑',
    'refpid': 'mm_26632258_3504122_32538762',
    'spm': 'tbpc.pc_sem_alimama/a.201867-main.d2_first.65192a89OyaLcj',
    'tab': 'all',
}

response = requests.get('https://uland.taobao.com/sem/tbsearch', params=params, cookies=cookies, headers=headers)
print(response.status_code)
print(response.text)